<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<script>
    //1*/
    function eventJson() {
        let action = {
            action:'callPhone',
            phone:'4009661988'
        }
        demo.event(JSON.stringify(action))
    }
    //扫一扫
    function fooScan() {
        /// 扫一扫
        demo.clickOnScan()
    }
    //选择图片
    function fooTu() {
        /// 选择图片
        demo.clickOnImage()
    }
    //选择文件
    function fooFile() {
        /// 选择文件
        demo.clickOnFile()
    }

    //导航（没有起点）
    function onLocation() {
        let json = {
            dropEnd:{latitude: 40.01817,longitude: 116.411161,name:'搜索栏终点的名称'}
        }
        demo.clickOnDaoHang(JSON.stringify(json))
    }

    //导航*/
    function daoHang() {
        let json = {
            dropStart:{latitude: 34.207281,longitude: 108.830595,name: '搜索栏起点的名称'},
            dropEnd:{latitude: 40.01817,longitude: 116.411161,name: '搜索栏终点的名称'}
        }
        demo.clickOnDaoHang(JSON.stringify(json))
    }

    /////
    function callPhone() {
        /// 点击打电话
        demo.callPhone("4009661988")
    }
    function callShortLetter() {
        /// 点击发短信
        demo.callShortLetter("4009661988","这是测试短信内容")
    }
    function onAction() {
        /// 点击打开浏览器
        demo.clickAction("https://www.baidu.com")
    }

</script>
<body>
<div style="display: flex; align-items: center; justify-content: center; width: 100vw; height: 100vh; flex-direction: column;">
    <div style=" display: flex;">
        <div>
            <button style="width: 100px; height: 50px;" onclick="eventJson()">调用Event管理</button>
        </div>
        <div style="height: 50px">
            <button style="width: 100px; height: 50px;" onclick="fooScan()">点击扫一扫</button>
        </div>
        <div style="height: 50px">
            <button style="width: 100px; height: 50px;" onclick="fooTu()">点击选择图片</button>
        </div>
    </div>
    <div style="height: 50px; display: flex; margin-top: 10px;">
        <div style="height: 50px">
            <button style="width: 100px; height: 50px;" onclick="fooFile()">点击选择文件</button>
        </div>
        <div style="height: 50px">
            <button style="width: 100px; height: 50px;" onclick="onLocation()">
                点击开始导航（没有起点）
            </button>
        </div>
        <div style="height: 50px">
            <button style="width: 100px; height: 50px;" onclick="daoHang()">点击开始导航</button>
        </div>
    </div>
    <div style="height: 50px; display: flex; margin-top: 10px;">
        <div style="height: 50px">
            <button style="width: 100px; height: 50px;" onclick="callPhone()">点击打电话</button>
        </div>
        <div style="height: 50px">
            <button style="width: 100px; height: 50px;" onclick="callShortLetter()">点击发短信
            </button>
        </div>
        <div style="height: 50px">
            <button style="width: 100px; height: 50px;" onclick="onAction()">点击打开浏览器</button>
        </div>
    </div>
</div>
</body>
</html>